#pragma once
#include "ZuiLib.h"
#include "LRefObject.h"

namespace ZuiLib {

class LOption :public LRefObject<ZOption>
{
public:

	int getSelectedImage(LuaFuncState& L)
	{
		return L.lreturn(pThis->GetSelectedImage());
	}

	int setSelectedImage(LuaFuncState& L)
	{
		pThis->SetSelectedImage(L.arg(0).toString());
		return 0;
	}

	int getSelectedTextColor(LuaFuncState& L)
	{
		return L.lreturn(pThis->GetSelectedTextColor());
	}

	int setSelectedTextColor(LuaFuncState& L)
	{
		pThis->SetSelectedTextColor(toColor(L.arg(0)));
		return 0;
	}

	int getForeImage(LuaFuncState& L)
	{
		return L.lreturn(pThis->GetForeImage());
	}

	int setForeImage(LuaFuncState& L)
	{
		pThis->SetForeImage(L.arg(0).toString());
		return 0;
	}

	int getGroup(LuaFuncState& L)
	{
		return L.lreturn(pThis->GetGroup());
	}

	int setGroup(LuaFuncState& L)
	{
		pThis->SetGroup(L.arg(0).toString());
		return 0;
	}

	int isSelected(LuaFuncState& L)
	{
		return L.lreturn(pThis->IsSelected());
	}

	int selected(LuaFuncState& L)
	{
		pThis->Selected(L.arg(0).toBool());
		return 0;
	}


	BEGIN_MAP_FUNC(LOption)
		DECLARE_FUNC(getSelectedImage),
		DECLARE_FUNC(setSelectedImage),
		DECLARE_FUNC(getSelectedTextColor),
		DECLARE_FUNC(setSelectedTextColor),
		DECLARE_FUNC(getForeImage),
		DECLARE_FUNC(setForeImage),
		DECLARE_FUNC(getGroup),
		DECLARE_FUNC(setGroup),
		DECLARE_FUNC(isSelected),
		DECLARE_FUNC(selected),
	END_MAP_FUNC
};

}//namespace
